/**
 * Created by LeungZ on 2016/8/8.
 */
import temp from './lessee.html';
import ctrl from './lessee.ctrl.js';


import createTemp from './create/create.html';
import createCtrl from './create/create.ctrl.js';

import basemsgTemp from './create/basemsg/basemsg.html';
import basemsgCtrl from './create/basemsg/basemsg.ctrl.js';
import customTemp from './create/custom/custom.html';
import customCtrl from './create/custom/custom.ctrl.js';



export default angular.module('ctg-k8sconsole').config(['$stateProvider', $stateProvider => {
    $stateProvider.state('k8s-lessee', {
            url: '/k8s/lessee?kDbCode',
            templateUrl: temp,
            controller: ctrl,
            controllerAs: 'list',
            resolve: {
                list: ['LesseeSrv', 'ctgNotification', '$stateParams', function(LesseeSrv, ctgNotification, $stateParams) {
                    return LesseeSrv.getRCList({page: 1, code: $stateParams.kDbCode}).catch(function (data) {
                      
                        ctgNotification.error('获取服务列表数据有误.');
                    });
                    // return $http.get('http://localhost:33001/src/pages/k8s/lessee/lesseetable.json');
                }]
            }
        })
        .state('create', {
            url: '/k8s/lessee/create?:kDbCode&:lesId',
            templateUrl: createTemp,
            controller: createCtrl,
            controllerAs: 'vm',
        })
        .state('create.basemsg', {
            url: '/basemsg',
            templateUrl: basemsgTemp,
            controller: basemsgCtrl,
            controllerAs: 'vm',
        })
        .state('create.custom', {
            url: '/custom',
            templateUrl: customTemp,
            controller: customCtrl,
            controllerAs: 'vm',
        })
}]);